package m202406.d05;

import java.math.BigInteger;
import java.util.Scanner;

/**
 * @@author: 爱做梦的锤子
 * @date: 2024/6/5 14:17
 */
//(C卷,200分)- 抢7游戏
public class C200_03 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int m = scanner.nextInt();

        int one = m - 7;
        int two = 0;
        System.out.println(handle(one, two));
    }

    private static BigInteger handle(int one, int two) {
        BigInteger[] cache = new BigInteger[one + two + 1];
        BigInteger rs = new BigInteger("0");
        while (one > 0) {
            if ((one + two) % 2 == 1) {
                rs = rs.add(getRs(cache, one, two));
            }
            one = one - 2;
            two = two + 1;
        }
        return rs;
    }

    private static BigInteger getRs(BigInteger[] cache, int one, int two) {
        if (one == 0 || two == 0) {
            return new BigInteger("1");
        }
        if (cache[one] == null) {
            cache[one] = doCache(one);
        }
        if (cache[two] == null) {
            cache[two] = doCache(two);
        }
        if (cache[one + two] == null) {
            cache[one + two] = doCache(one + two);
        }
        return cache[one + two].divide(cache[one].multiply(cache[two]));
    }

    private static BigInteger doCache(int n) {
        BigInteger rs = new BigInteger("0");
        for (int i = 1; i <= n; i++) {
            rs = rs.multiply(new BigInteger(String.valueOf(i)));
        }
        return rs;
    }

}
